Method and apparatus for controlling image display during image editing

ABSTRACT

A method is performed at a computing device for controlling image display during image editing, the method including: loading, into the memory, an obtained to-be-edited image; identifying a primary area in the loaded image, the primary area including one or more objects that are automatically recognized as subjects of the loaded image; adjusting the primary area in the loaded image in accordance with a fitting state between the loaded image and a preset template when a center of the primary area is initially located at a center of a display area of the preset template; and displaying, on the screen, the adjusted primary area in the loaded image to occupy the display area of the template completely.

RELATED APPLICATION

This application is a continuation-in-part of PCT/CN2016/102329,entitled “METHOD AND DEVICE FOR CONTROLLING PICTURE DISPLAY IN PICTUREEDITING” filed on Oct. 18, 2016, which claims priority to Chinese PatentApplication No. 201510843542.X, filed with the State IntellectualProperty Office of the People's Republic of China on Nov. 26, 2015, andentitled “METHOD AND APPARATUS FOR CONTROLLING IMAGE DISPLAY DURINGIMAGE EDITING”, both of which are incorporated herein by reference intheir entirety.

FIELD OF THE TECHNOLOGY

The present disclosure relates to the field of computer applicationtechnologies, and in particular, to a method and an apparatus forcontrolling image display during image editing.

BACKGROUND OF THE DISCLOSURE

With the rapid development of computer application technologies, variousimage editing applications emerge. By using simple and practical imageediting functions of the image editing applications, a user can easilyproduce images with various effects. Therefore, image editingapplications have been popular among a wide range of users.

In existing image editing applications, multiple templates of differenttypes are usually preset for selection by a user, so that after the userselects a to-be-edited image and a template, the to-be-edited image in adisplay area of the template. In the image display process, the size ofthe display area of the template selected by the user is not alwaysexactly equal to the size of the image. To fit the image to the displayarea, a common method is to directly select a central area of the imageand display the central area in the display area of the template.However, in this case, content presented in the display area of thetemplate to the user may not be important content in the image.

In addition, the user usually adjusts the range of the display area ofthe template as required, for example, drags the right border of thedisplay area to enlarge the range of the display area. After the rangeof the display area is changed, to fit the previous image to the changeddisplay area again, a common method is to continue to present a part ofthe image that is not displayed to the user along the draggingdirection. Similarly, in this case, content presented in the displayarea of the template to the user may not be important content in theimage.

As described above, in the existing image display process during imageediting, the accuracy of image display is unsatisfactory.

SUMMARY

Based on the above, embodiments of the present application provide amethod for controlling image display during image editing capable ofimproving the accuracy of image display.

In addition, embodiments of the present application provide an apparatusfor controlling image display during image editing capable of improvingthe accuracy of image display.

To resolve the foregoing technical problem, technical solutions used bythe present disclosure are as follows:

A method for controlling image display during image editing comprises:loading an obtained to-be-edited image; identifying a primary area inthe loaded image; embedding the image into a preset template; anddisplaying the primary area in the center of the display area of thetemplate, and adjusting the image according to a fitting state betweenthe embedded image and the display area, so as to fit the image to thedisplay area.

An apparatus for controlling image display during image editingincludes: a loading module, configured to load an obtained to-be-editedimage; an identifying module, configured to identify a primary area inthe loaded image; an embedding module, configured to embed the imageinto a preset template; and a fitting module, configured to display theprimary area in the center of the display area of the template andadjust the image according to a fitting state between the embedded imageand the display area, so as to fit the image to the display area.

Compared with the existing technology, the present disclosure has thefollowing beneficial effects.

By identifying a primary area of a loaded to-be-edited image, embeddingthe to-be-edited image into a preset template, displaying the identifiedprimary area in the center of a display area of the template, anddynamically adjusting the image according to a fitting state between theembedded image and the display area, the image is fitted to the displayarea adaptively. That is, by displaying the primary area in the centerand dynamically adjusting the image adaptively, the image displayed inthe display area of the template is the image containing importantcontent, so that a problem that content presented in the display area ofthe template to a user may not be important content in the image isresolved, the accuracy of image display is improved effectively and userexperience is improved.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a flowchart of a method for controlling image display duringimage editing according to an embodiment;

FIG. 2 is a flowchart of a method for controlling image display duringimage editing according to another embodiment;

FIG. 3 is a schematic diagram of obtaining, by means of listening, anoperation triggering dragging a border in a display area, and adjustingthe range of the display area by means of the operation according to anembodiment;

FIG. 4 is a schematic diagram of triggering and moving, according to adragging direction of dragging the border, a longest side on which theborder is located and forming a new layout of display areas of thetemplate in FIG. 2;

FIG. 5 is a schematic diagram of triggering and moving, according to adragging direction of dragging the border, a longest side on which theborder is located and forming a new layout of display areas of thetemplate in FIG. 2;

FIG. 6 is a schematic diagram of triggering and moving, according to adragging direction of dragging the border, a longest side on which theborder is located and forming a new layout of display areas of thetemplate in FIG. 2;

FIG. 7 is a flowchart of a method for dynamically adjusting the imageaccording to the fitting state between the embedded image and thedisplay area in FIG. 1;

FIG. 8 is a schematic diagram of the fitting state that two oppositeborders of the display area extend beyond the image in FIG. 7;

FIG. 9 is a schematic diagram of scaling up the image by using a centerposition of the primary area displayed in the center as a reference inFIG. 7;

FIG. 10 is a structural block diagram of a system for controlling imagedisplay during image editing according to an embodiment;

FIG. 11 is a structural block diagram of a system for controlling imagedisplay during image editing according to another embodiment;

FIG. 12 is a structural block diagram of a fitting module according toan embodiment; and

FIG. 13 is a schematic structural diagram of a client terminal accordingto embodiments of the present application.

DESCRIPTION OF EMBODIMENTS

Typical implementations showing features and advantages of the presentdisclosure are described in detail below. It should be understood thatthe present disclosure may have some variations in differentimplementations without departing from the scope of the presentdisclosure, and descriptions and figures are essentially used forillustrating the present disclosure and are not intended to limit thepresent disclosure.

Refer to FIG. 1 for a method for controlling image display during imageediting in an embodiment. The method may be applied to a clientterminal, the client terminal may be operated on a computing device, andthe computing device may be a smartphone, a tablet, or a computer, eachhaving one or more processors, a screen, and memory storing programs tobe executed by the processors for controlling the image display. Themethod includes the following steps:

Step S110: Load an obtained to-be-edited image.

An approach to obtain the to-be-edited image may be scanning theto-be-edited image, selecting from images pre-stored in a media libraryor directly taking a photo of an external object.

In this embodiment, loading the obtained to-be-edited image isimplemented by a client terminal, so that the loaded image can completethe image display control during image editing on the client terminal.

The client terminal may be running a software application for imageediting, such as an image editing application, or may be a web pageapplication for image editing, such as an image editing website.

Step S130: Identify a primary area in the loaded image.

The primary area refers to main content in the image, for example, theprimary area in an image of a person should be the person. In someembodiments, the operation of identifying a primary area in the imageimplements one or more machine learning methods (e.g., patternrecognition) for object detection, classification, and computer visionsegmentation. Pattern recognition is the process of classifying inputdata (images) into objects or classes based on key features (e.g.,facial characters), which can be supervised or unsupervisedclassification. In this application, the output of this process is theprimary area that starts at the center region of the image and expandsin both horizontal and vertical directions until that it includes thesubjects of the loaded image. In some embodiments, the identification ofthe primary area is supported using one or more image capturingparameters (e.g., depth of field, focal length, etc.).

Further, if the identifying of the primary area succeeds, the primaryarea is recorded by the client terminal, so as to display the primaryarea in the subsequent process of image editing. If the identifying ofthe primary area fails, the client terminal obtains, by means oflistening, a manual adjusting operation triggered by a user in theloaded image, and the client terminal is assisted by the manualadjusting operation to identify the primary area until the identifyingof the primary area succeeds.

By identifying a primary area in a loaded image, it is beneficial tobetter present main content of the image to a user, thereby improvingthe accuracy of image display.

Step S150: Embed the image into a preset template.

The template may be a fixed format of a display area constituting theimage and is preset by a client terminal. The client terminal may presetmultiple template types for selection by the user.

For example, a single splice template includes one display area; adouble splice template includes two display areas, and the two displayareas may be spliced up and down or spliced left and right; and a multisplice template is spliced by multiple display areas in differentsplicing manners.

After the user selects the preset template, the image is embedded intothe preset template by the client terminal and displayed in the displayarea of the template.

Step S170: Display the primary area in the center of a display area ofthe template and dynamically adjust the image according to a fittingstate between the embedded image and the display area, so as to fit theimage to the display area adaptively.

The size of the embedded image is not always exactly equal to the sizeof the display area of the template, and the primary area of the imagerepresents main content in the image. Therefore, after the image isembedded into the preset template, by displaying the primary area in thecenter of the display area of the template, that is, aligning a centerposition of the primary area with a center position of the template, itis ensured that the primary area, that is, the main content in theimage, can be presented to the user.

If the template with the embedded image cannot display the primary areacompletely, or a display area without image display still exists in thetemplate, the client terminal will fill the display area without imagedisplay according to a part of the image that is not displayed, so as tofit the image to the display area.

Specifically, relative to borders of the display area of the templateand classified according to the part of the image that is not displayed,the fitting state between the image and the display area includes: theimage being fitted to the width and height of the display area, theprimary area extending beyond the display area, two opposite borders ofthe display area extending beyond the image, and any border of thedisplay area extending beyond the image.

The first type indicates that the image is fitted to the display area,that is, all borders of the template do not extend beyond the image. Inthis case, the client terminal does not work on the image. The laterthree types indicate that the image is not fitted to the display area.It may be that the primary area is not displayed completely, or displayareas without image display exist in two opposite sides of the template,or a display area without image display exists in any side of thetemplate. In this case, the client terminal needs to dynamically adjustthe image adaptively until the image is fitted to the display area.

In some embodiments, the operation is further divided into two steps.The first step is to adjust the primary area in the loaded image inaccordance with a fitting state between the loaded image and a presettemplate when a center of the primary area is initially located at acenter of a display area of the preset template. In other words, thestarting point of this adjustment process is to have the center of theprimary area located at the center of the display area of the presettemplate and the ending point of this adjustment process is to make surethat there is no empty room left in the display area and, afteradjustment, the display area of the template is completely occupied bythe adjusted primary area (which may or may not be the same as theoriginally identified primary area). During this process, the primaryarea should not be adjusted to leave out any subject of the loadedimage. To so, it is important to continuously measure the fitting statebetween the loaded image and the preset template, which is dependentupon at least one of a size comparison of the loaded image and thepreset template and a position of the primary area in the loaded image.For example, if the size of the loaded image is smaller than that of thepreset template, the primary area is enlarged by a ratio in bothhorizontal and vertical directions to occupy the display areacompletely. But when the size of the loaded image is greater than thatof the preset template, whether or not the primary area should bereduced by a ratio depends in part on the position of the primary areain the loaded image. When the primary area is located near the center ofthe loaded image, it may be able to occupy the display area completelyby shifting a predefined offset without having to be reduced as long assuch shifting does not push any subject of the image out of the primaryarea.

In other words, the operation of adjusting the primary area in theloaded image in accordance with a fitting state between the loaded imageand a preset template is a combination of changing a size of the loadedimage by a ratio determined by the fitting state and shifting the loadedimage by an offset determined by the fitting state. For example, whenthe fitting state indicates that the primary area extends beyond thedisplay area in both a vertical direction and a horizontal direction,the primary area is reduced by a ratio determined by the fitting statesuch that the reduced primary area no longer extends beyond the displayarea in at least one of the vertical direction and the horizontaldirection. When the fitting state indicates that the loaded image iswithin two opposite borders of the display area along a predefineddirection, the loaded image is enlarged by a ratio determined by thefitting state such that the enlarged image is no longer within the twoopposite borders of the display area along the predefined direction.When the fitting state indicates that the loaded image is within atleast one border of the display area along a predefined direction, theloaded image is shifted by an offset determined by the fitting statesuch that the shifted image is no longer within the at least border ofthe display area along the predefined direction. In some embodiments,the shifted image is further scaled by a ratio determined by the fittingstate such that no subject of the loaded image is outside the displayarea.

By means of the processes described above, a client terminal canaccurately display a primary area of an image in a display area of atemplate and dynamically adjust the image adaptively according tochanges of the range of the display area or changes of the image (forexample, the range of the display area is scaled up, or a replaced imageis scaled down), dynamic display of the image in the display area of thetemplate is achieved, and main content in the image is presented in thedisplay area of the template to a user, thereby effectively improvingthe accuracy of image display, obtaining a better effect of imagedisplay, and improving experience of the user.

In an embodiment, after S170, the method described above furtherincludes the following steps: obtaining, by means of listening, anoperation triggering adjusting a border of the display area, so as toadjust the range of the display area by means of the operation. In otherwords, when a user of the client terminal adjusts a border of thedisplay area, the first-adjusted primary area needs to be re-adjusted tofit into the updated display area according to the same set of rules,i.e., the subjects of the loaded image be kept in the display area andthere is no empty room in the display area not occupied by the loadedimage. To do so, the client terminal may perform the same set ofoperations as described above in connection with FIG. 1.

In an embodiment, the range of the display area is adjusted in responseto the operation of dragging the border in the display area.

The range of the display area is limited. If the range of the displayarea needs to be changed, the client terminal obtains, by means oflistening, the operation triggering dragging the border in the displayarea and adjusts the range of the display area by means of theoperation, so as to change the range of the display area.

It should be noted that, the operation triggered by the user may be anoperation triggered by adjusting a border of the display area, or anoperation triggered by dragging an angle of the display area. In thiscase, two adjacent borders in the display area are dragged.

As shown in FIG. 3, in the template, the displayed area is adjustedrightwards by means of an operation 310 triggered by the user draggingrightwards the right border in the display area, thereby scaling up therange of the display area.

Further, after the range of the display area is changed, based on thatthe primary area is displayed in the center, the fitting state betweenthe image and the display area may also be changed correspondingly.Therefore, a dynamic adjusting of the image is adaptively triggered inthe display area of the template, so as to fit the image to the displayarea again.

The process of S170 is performed whether in the first adaptive fittingbetween the image and the displaying area, or the second adaptivefitting triggered by changes of the range of the display area or changesof the image, so as to achieve dynamic display of the image in thedisplay area changed dynamically.

It is worth mentioning that to achieve the dynamic display of the imagein the display area changed dynamically, if the preset template ischanged; processes from S150 to S170 are performed.

Referring to FIG. 2, in an embodiment, the template includes a displayarea in which dragging the border is triggered and at least onesurrounding display area.

In this embodiment, the template preset by the client terminal isspliced by multiple display areas in different splicing manners.Therefore, when one of the display areas changes the range of thedisplay area by means of triggering dragging the border, ranges of othersurrounding display areas adjacent to the display area will be affectedand changed.

Further, after S170, the method described above further includes thefollowing steps.

Step S210: Trigger and move, according to a dragging direction ofdragging the border, a longest side on which the border is located andenable the longest side to stay on a current location when the operationis stopped.

Step S230: The staying longest side re-intersects adjacent borders indisplay areas of the template to form a new layout of the display areasof the template.

The longest side on which the border is located may be the border, ormay be constituted by borders of multiple display areas together. In allcases, after the longest side is triggered to move, ranges of thedisplayed areas on two sides of the longest side will be changed, so asto form the new layout of the display areas of the template.

In an embodiment, the longest side on which the border is located ismoved according to the dragging direction of the operation; and thedisplay areas in the template are re-formed according to the location ofthe longest side when the operation is stopped. After the range of thedisplay area is adjusted, other display areas in the template arere-formed according to the location of the longest side when theoperation is stopped, the display area being adjacent to the otherdisplay areas by means of the longest side.

As shown in FIG. 4, when the longest side 450 on which the border islocated is constituted by borders of multiple display areas together,according to the dragging direction 430 of dragging the border 411, thelongest side 450 on which the border 411 is located is triggered to movealong the dragging direction 430, and a border 412 not adjacent to thelongest side 450 and corresponding vertices A, B, C are not moved.

When the operation is stopped, a longest side 470 staying on the currentlocation is formed. The staying longest side 470 re-intersects theadjacent borders 413, 414, 415 of the display areas of the template, andnew vertices D, E, F are formed respectively, so as to form a new layoutof the display areas in the template, that is, ranges of the displayareas 1, 2, 3 are scaled up and ranges of the display areas 4, 5 arescaled down.

As shown in FIG. 5, when the longest side 511 on which the border islocated is the border 511, according to the dragging direction 530 ofdragging the border 511, the longest side 511 on which the border 511 islocated is triggered to move along the dragging direction 530, and otherborders not adjacent to the longest side 511 and corresponding verticesare not moved.

When the operation is stopped, the longest side 550 staying on thecurrent location is formed. The staying longest side 550 re-intersectsthe border 512 adjacent to the display areas in the template, and a newvertex G is formed, so as to form the new layout of the display areas inthe template, that is, the range of the display area 6 is scaled up andthe range of the display area 7 is scaled down.

It is worth mentioning that, in this embodiment, the dragging of theborder is limited. As shown in FIG. 6, the longest side 610 on which theborder 610 is located is dragged along the dragging direction 630, whena distance between the border 610 and the border 650 reaches a presetsmallest width, the border 610 cannot be dragged along the draggingdirection 630 anymore.

Further, after the ranges of other display areas are changed, based onthat the primary area is displayed in the center, the fitting statebetween the image and the other display areas may be changedcorrespondingly. Therefore, the dynamic adjusting of the image will alsobe triggered in the other display areas of the template, so that theimage is adaptively fitted to the other display areas again, that is,the process of S170 is performed, thereby achieving the dynamic displayof the image in the display area changed dynamically.

As described above, the fitting state between the image and the displayarea includes: the image being fitted to the height and width of thedisplay area, the primary area extending beyond the display area, twoopposite borders of the display area extending beyond the image, and anyborder of the display area extending beyond the image.

Based on that the primary area is displayed in the center of the displayarea of the template, the step of dynamically adjusting the imageaccording to the fitting state between the image and the display areavaries with the different fitting states between the image and thedisplay area. The step is described below with reference to FIG. 7 toFIG. 9.

In an embodiment, the fitting state is that the primary area extendsbeyond the display area 710 and the step of dynamically adjusting theimage according to the fitting state between the embedded image and thedisplay area includes the following steps:

Step S171: Scale down the primary area by using a central position ofthe primary area displayed in the center as a reference.

In this embodiment, whether in the first fitting or the second fittingafter the range of the display area or the image is changed, after theprimary area is displayed in the center of the display area of thetemplate, if the primary area displayed in the center extends beyond thedisplay area, to ensure that the image presented in the template to theuser includes important content in the image, that is, the primary area,the extending primary area is scaled down by using the central positionof the primary area as a reference, so that the scaled-down primary areais fitted to the display area.

In an embodiment, the fitting state is that two opposite borders of thedisplay area extend beyond the image 730 and the step of dynamicallyadjusting the image according to the fitting state between the embeddedimage and the display area includes the following steps:

Step S173: Scale up the image by using a central position of the primaryarea displayed in the center as a reference.

For example, after the display area is fitted to the image, that is, thedisplay area is completely filled by the embedded image, if a lowerborder of the display area is continue to be dragged downward, a displayarea (as shown in the shadow filling box in FIG. 8) without imagedisplay will occur in the template because the image in the verticaldirection has been displayed in the display area completely before.

In this case, the client terminal aligns the central position of theprimary area with the central position of the display area. Based onthat the primary area is displayed in the center of the display area ofthe template, in the two opposite borders of the display area, the upperborder and the lower border (shown as the bold sold line in FIG. 8) bothextend beyond the image (shown as the dashed line in FIG. 8) of whichthe primary area is displayed in the center, that is, the fitting stateis that the two opposite borders of the display area extend beyond theimage 730. At this time, the image is scaled up by using the centralposition of the primary area displayed in the center as a reference, sothat the scaled-up image is fitted to the display area, as shown in FIG.9.

By means of the process described above, based on that the primary areais displayed in the center, the scaling image is capable of being fittedto the display area. Therefore, it is ensured that content presented inthe display area of the template includes important content in theimage, improving the accuracy of image display, obtaining a bettereffect of image display, and improving experience of the user.

In an embodiment, the fitting state is that any border of the displayarea extends beyond the image 750.

It can be understood that, in this embodiment, that any border of thedisplay area extends beyond the image 750 may be that only one border inthe display area extends beyond the image or any two adjacent borders inthe display area extend beyond the image, while that two oppositeborders of the display area extend beyond the image is not included.

Further, the step of adjusting the image according to a fitting statebetween the embedded image and the display area includes the followingsteps.

Step S175: Obtain a part of the image that is not displayed relative tothe border of the display area.

When the fitting state is that any border of the display area extendsbeyond the image 750, that is, a display area without image displayexists on one side relative to the border of the display area in thetemplate, in this case, to fill the display area without image display,the client terminal determines, relative to the border of the displayarea, that whether the part of the image that is not displayed can beobtained.

If the part of the image that is not displayed can be obtained, performStep S177 to fill, by the client terminal, the display area withoutimage display with the part of the image that is not displayed.

If the part of the image that is not displayed cannot be obtained, itmeans that the image is completely displayed in the display area of thetemplate. At this time, the image is scaled up by using the centralposition of the primary area displayed in the center as a reference, sothat the client terminal fills the display area without image displaywith the scaled-up image.

Step S177, Move the part of the image that is not displayed to theborder of the display area.

After the part of the image that is not displayed is obtained relativeto the border of the display area, by moving the part of the image thatis not displayed to the border of the display area, the display areawithout image display is filled with the moved image, so that the imageis fitted to the display area adaptively.

By means of the process described above, after the image is moved, thepart of the image that is not displayed is moved into the display areacorrespondingly, and the primary area is moved. The moved primary areais not displayed in the center any more, however, after the moved imageis fitted to the display area, content presented in the display area ofthe template to the user includes more content in the image, such thatthe accuracy of image display is ensured and experience of the user isimproved.

In an embodiment, the fitting state is that one border of the displayarea extends beyond the image, the adjusting the image according to thefitting state between the embedded image and the display areaspecifically includes the following processing: obtaining the part ofthe image that is not displayed corresponding to the border and movingthe part of the image that is not displayed to the border of the displayarea.

Furthermore, it is worth mentioning that, whether in the first fittingor the subsequent second fitting after the range of the display area orthe image is changed, if the display area of the template is completelyfilled with the embedded image when the client terminal aligns thecenter position of the primary area with the center position of thedisplay area of the template, that is, the primary area is displayed inthe center of the template. At this time, the fitting state between theimage and the display area is that the image is fitted to the height andwidth of the display area, so that the client terminal does notdynamically adjust the embedded image, but directly presents the imageembedded into the display area of the template to the user.

Referring to FIG. 10, in an embodiment, an apparatus for controllingimage display during image editing includes a loading module 810, anidentifying module 830, an embedding module 850 and a fitting module870.

The loading module 810 is configured to loading an obtained to-be-editedimage.

The identifying module 830 is configured to identify a primary area inthe loaded image.

The embedding module 850 is configured to embed the image into a presettemplate.

The fitting module 870 is configured to display the primary area in thecenter of a display area of the template and dynamically adjust theimage according to a fitting state between the embedded image and thedisplay area, so as to fit the image to the display area adaptively.

In an embodiment, the fitting module 870 is configured to display theprimary area in the center of the display area of the template andadjust the image according to the fitting state between the embeddedimage and the display area, so as to fit the image to the display area.

In an embodiment, the apparatus described above further includes alistening module configured to listen to and obtain an operationtriggering dragging a border of the display area, so as to adjust therange of the display area by means of the operation.

In an embodiment, the listening module is configured to adjust the rangeof the display area in response to the operation of dragging the borderof the display area.

Referring to FIG. 11, in an embodiment, the apparatus described abovefurther includes a moving module 910 and an intersecting module 930.

The moving module 910 is configured to trigger and move a longest sideon which the border is located according to the dragging direction ofdragging the border and enable the longest side to stay on a currentlocation when the operation is stopped.

The intersecting module 930 is configured to re-intersect the stayinglongest side with adjacent borders in display areas of the template toform a new layout of the display areas of the template.

In an embodiment, the moving module 910 is configured to move, accordingto the dragging direction of the operation, the longest side on whichthe border is located.

The intersecting module 930 is configured to re-form the display area inthe template according to the location of the longest side when theoperation is stopped.

Referring to FIG. 12, in an embodiment, the fitting state is that theprimary area extends beyond the display area, and the fitting module 870includes a scale-down unit 871 configured to scale down the primary areaby using the central position of the primary area displayed in thecenter as a reference.

Referring to FIG. 12, in an embodiment, the fitting state is that twoopposite borders of the display area extend beyond the image, and thefitting module 870 includes a scale-up unit 873 configured to scale upthe image by using the central position of the primary area displayed inthe center as a reference.

Referring to FIG. 12, in an embodiment, the fitting state is that anyborder of the display area extends beyond the image, and the fittingmodule 870 includes an obtaining unit 875 and a moving unit 877.

The obtaining unit 875 is configured to obtain a part of the image thatis not displayed relative to the border of the display area.

The moving unit 877 is configured to move the part of the image that isnot displayed to the border of the display area.

In an embodiment, the obtaining unit 875 is configured to obtain a partof the image that is not displayed corresponding to the border.

The moving unit 877 is configured to move the part of the image that isnot displayed to the border of the display area.

Referring to FIG. 13, FIG. 13 is a schematic structural diagram of aclient terminal 1200 according to an embodiment of the presentapplication. The steps in the above embodiments performed by the clientterminal cam be based on the structure of the client terminal shown inthis figure.

The client terminal 1200 may vary greatly for differences inconfiguration or performance, and includes a power supply 1210, aninterface 1230, at least one computer readable storage medium 1250 andat least one central processing unit (CPU) 1270. In some embodiments,the client terminal 1200 includes a screen (e.g., a touch screen) fordisplaying images and text processed by the client terminal 1200. Insome embodiments, the screen is not part of the client terminal 1200 butis communicatively connected to the client terminal 1200 via a cable orwirelessly.

Specifically, the power supply 1210 is configured to supply workingvoltage for hardware devices on the client terminal 1200.

The interface 1230 includes at least one wired or wireless networkinterface 1231, at least one serial-to-parallel conversion interface1233, at least one input/output interface 1235 and at least one USBinterface 1237, configured to communicate with an external device.

The storage medium 1250, as a carrier for storing resources, may be arandom storage memory, a disk or a compact disc. The resources stored onthe storage medium 1250 include an operating system 1251, an application1253 and data 1255. The storage manner may be temporary storage andnon-transitory permanent storage. The operating system 1251 isconfigured to manage and control hardware devices on the client terminal1200 and the application 1253, so that the central processing unit 1270performs calculation and processing on the massive data 1255. Theoperating system 1251 may be Windows Server™, Mac OS X™, Unix™, Linux™,FreeBSD™ or the like. The application 1253 is a computer program basedon the operating system 1251 and finishing at least one specific work.The application 1253 may include at least one module (not shown in thefigure) and each module may include a series of operating instructionsfor the client terminal 1200. The data 1255 may be images stored in thedisk or the like.

The central processing unit 1270 may include one or more processors andbe set to communicate with the storage medium 1250 by means of a bus.The central processing unit 1270 is configured to calculate and processthe massive data 1255 in the storage medium 1250.

The series of operating instructions stored in the storage medium 1250is read by the central processing unit 1270 and performed on the clientterminal 1200 based on the operating system 1251 on the storage medium1250, so that some steps or all steps in the above embodiments may befinished by operating related computer programs on the client terminal.

The above descriptions are merely preferred embodiments of the presentapplication, and are not intended to limit the solutions of the presentdisclosure. A person of ordinary skill in the art may make correspondingvariations or modifications conveniently according to the main conceptsand spirits of the present disclosure. Therefore, the protection scopeof the present disclosure should be subject to the protection scoperequired by the claims.

What is claimed is:
 1. A method for controlling image display duringimage editing performed at a computing device having one or moreprocessors, a screen, and memory storing a plurality of programs to beexecuted by the one or more processors, the method comprising: loading,into the memory, an obtained to-be-edited image; identifying a primaryarea in the loaded image, the primary area including one or more objectsthat are automatically recognized as subjects of the loaded image;adjusting the primary area in the loaded image in accordance with afitting state between the loaded image and a preset template when acenter of the primary area is initially located at a center of a displayarea of the preset template; and displaying, on the screen, the adjustedprimary area in the loaded image to occupy the display area of thetemplate completely.
 2. The method according to claim 1, furthercomprising: re-adjusting the adjusted primary area in the loaded imagein response to an operation of adjusting a border of the display area.3. The method according to claim 2, wherein the operation ofre-adjusting the adjusted primary area in the loaded image in responseto an operation of adjusting a border of the display area comprises:moving, according to a dragging direction of the operation, a longestside on which the border is located; re-forming the display area in thetemplate according to a location of the longest side when the operationis stopped; and second-adjusting the adjusted primary area in the loadedimage to occupy the display area of the template completely.
 4. Themethod according to claim 1, wherein the fitting state is dependent uponat least one of a size comparison of the loaded image and the presettemplate and a position of the primary area in the loaded image.
 5. Themethod according to claim 1, wherein the operation of adjusting theprimary area in the loaded image in accordance with a fitting statebetween the loaded image and a preset template is a combination ofchanging a size of the loaded image by a ratio determined by the fittingstate and shifting the loaded image by an offset determined by thefitting state.
 6. The method according to claim 1, wherein, when thefitting state indicates that the primary area extends beyond the displayarea in both a vertical direction and a horizontal direction, theprimary area is reduced by a ratio determined by the fitting state suchthat the reduced primary area no longer extends beyond the display areain at least one of the vertical direction and the horizontal direction.7. The method according to claim 1, wherein, when the fitting stateindicates that the loaded image is within two opposite borders of thedisplay area along a predefined direction, the loaded image is enlargedby a ratio determined by the fitting state such that the enlarged imageis no longer within the two opposite borders of the display area alongthe predefined direction.
 8. The method according to claim 1, wherein,when the fitting state indicates that the loaded image is within atleast one border of the display area along a predefined direction, theloaded image is shifted by an offset determined by the fitting statesuch that the shifted image is no longer within the at least border ofthe display area along the predefined direction.
 9. The method accordingto claim 8, wherein the shifted image is further scaled by a ratiodetermined by the fitting state such that no subject of the loaded imageis outside the display area.
 10. A computing device for controllingimage display during image editing, comprising: one or more processors;a screen; memory; and a plurality of programs stored in the memory that,when executed by the one or more processors, cause the computing deviceto perform a plurality of operations including: loading, into thememory, an obtained to-be-edited image; identifying a primary area inthe loaded image, the primary area including one or more objects thatare automatically recognized as subjects of the loaded image; adjustingthe primary area in the loaded image in accordance with a fitting statebetween the loaded image and a preset template when a center of theprimary area is initially located at a center of a display area of thepreset template; and displaying, on the screen, the adjusted primaryarea in the loaded image to occupy the display area of the templatecompletely.
 11. The computing device according to claim 10, wherein theplurality of operations further include: re-adjusting the adjustedprimary area in the loaded image in response to an operation ofadjusting a border of the display area.
 12. The computing deviceaccording to claim 11, wherein the operation of re-adjusting theadjusted primary area in the loaded image in response to an operation ofadjusting a border of the display area comprises: moving, according to adragging direction of the operation, a longest side on which the borderis located; re-forming the display area in the template according to alocation of the longest side when the operation is stopped; andsecond-adjusting the adjusted primary area in the loaded image to occupythe display area of the template completely.
 13. The computing deviceaccording to claim 10, wherein the fitting state is dependent upon atleast one of a size comparison of the loaded image and the presettemplate and a position of the primary area in the loaded image.
 14. Thecomputing device according to claim 10, wherein the operation ofadjusting the primary area in the loaded image in accordance with afitting state between the loaded image and a preset template is acombination of changing a size of the loaded image by a ratio determinedby the fitting state and shifting the loaded image by an offsetdetermined by the fitting state.
 15. The computing device according toclaim 10, wherein, when the fitting state indicates that the primaryarea extends beyond the display area in both a vertical direction and ahorizontal direction, the primary area is reduced by a ratio determinedby the fitting state such that the reduced primary area no longerextends beyond the display area in at least one of the verticaldirection and the horizontal direction.
 16. The computing deviceaccording to claim 10, wherein, when the fitting state indicates thatthe loaded image is within two opposite borders of the display areaalong a predefined direction, the loaded image is enlarged by a ratiodetermined by the fitting state such that the enlarged image is nolonger within the two opposite borders of the display area along thepredefined direction.
 17. The computing device according to claim 10,wherein, when the fitting state indicates that the loaded image iswithin at least one border of the display area along a predefineddirection, the loaded image is shifted by an offset determined by thefitting state such that the shifted image is no longer within the atleast border of the display area along the predefined direction.
 18. Thecomputing device according to claim 17, wherein the shifted image isfurther scaled by a ratio determined by the fitting state such that nosubject of the loaded image is outside the display area.
 19. Anon-transitory computer readable storage medium in connection with acomputing device having one or more processors, memory and a screen forcontrolling image display during image editing, the storage mediumstoring a plurality of programs that, when executed by the one or moreprocessors, cause the computing device to perform a plurality ofoperations including: loading, into the memory, an obtained to-be-editedimage; identifying a primary area in the loaded image, the primary areaincluding one or more objects that are automatically recognized assubjects of the loaded image; adjusting the primary area in the loadedimage in accordance with a fitting state between the loaded image and apreset template when a center of the primary area is initially locatedat a center of a display area of the preset template; and displaying, onthe screen, the adjusted primary area in the loaded image to occupy thedisplay area of the template completely.
 20. The non-transitory computerreadable storage medium according to claim 19, wherein the fitting stateis dependent upon at least one of a size comparison of the loaded imageand the preset template and a position of the primary area in the loadedimage.